<!--
 * @Descripttion: 
 * @version: 
 * @Author: sueRimn
 * @Date: 2020-10-12 09:06:06
 * @LastEditors: sueRimn
 * @LastEditTime: 2020-11-30 10:24:04
-->
<template>
    <div class="rightGrid">
        <div
            class="gridItem"
            v-for="(item, index) in listData"
            :key="index"
            @click="toUrl(item)"
        >
            <div class="gridItemImg">
                <img :src="item.imgUrl" />
            </div>
            <div class="gridSubTitle">{{ item.subTitle }}</div>
            <div class="gridTitle">{{ item.title }}</div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        listData: {
            type: Array,
            default: () => []
        },
        classGro: {
            type: Array
        }
    },
    data() {
        return {};
    },
    methods: {
        toUrl(item) {
            if (!item.url) {
                return;
            }
            if (item.hasClass) {
                console.log(this.classGro);
                item.url = item.url + `?groupid=${this.classGro[0].groupid}`;
                if (item.type) {
                    item.url = item.url + `&type=0`;
                }
            }
            this.$router.push(item.url);
        }
    }
};
</script>

<style scoped lang="scss">
.rightGrid {
    width: 429px;
    padding-left: 25px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;

    .gridItem {
        width: 177px;
        height: 193px;
        border-radius: 8px;
        background: #ffffff;
        margin-right: 25px;
        margin-bottom: 15px;
        padding: 15px 20px;
        box-sizing: border-box;
        cursor: pointer;

        .gridItemImg {
            height: 96px;
            width: 96px;
            margin-bottom: 15px;

            img {
                height: 90px;
                width: 90px;
            }
        }

        .gridSubTitle {
            height: 19px;
            font-size: 14px;
            line-height: 19px;
            color: #9fa3b0;
            margin-bottom: 6px;
        }

        .gridTitle {
            height: 22px;
            font-size: 15px;
            line-height: 22px;
            color: #2c323f;
            font-weight: 600;
        }
    }
}
</style>
